function SetExpPath(pathT)

global expPath;

if nargin <1
    expPath = [uigetdir '\'];
else
    query1 = exist(pathT, 'dir');
    query2 = exist([pathT '\'], 'dir');
    if ~any([query1, query2])==0
        disp([pathT ' does not exist.']);
        expPath = [uigetdir '\'];    
    else
        expPath = pathT;
        if query2 == 1, expPath = [pathT '\']; end
    end
end

disp(['Path set to ' expPath]);

end
